package Entity;

import java.util.Vector;

import javax.microedition.lcdui.Graphics;

import Main.CObject;


public class Rec extends CObject{
//	public int x;
//	public int y;
//	public int w;
//	public int h;
	Vector vtLine= new Vector();
	public Rec(int x,int y,int w,int h)
	{
		this.x=x;
		this.y=y;
		this.h=h;
		this.w=w;
		Line line = new Line(x,y,x+w,y);
		Line line1 = new Line(x,y,x,y+h);
		Line line2 = new Line(x,y+h,x+w,y+h);
		Line line3 = new Line(x+w,y,x+w,y+h);
		vtLine.addElement(line);
		vtLine.addElement(line1);
		vtLine.addElement(line2);
		vtLine.addElement(line3);
	}
	public boolean LineCollisionRec(Line line)
	{
		for(int i=0;i<vtLine.size();i++)
		{
			Line tempLine=(Line) vtLine.elementAt(i);
			//this.check(line,tempLine);	
		}
		
		return false;
	}
	public void update()
	{		
		move(vx, vy);
		vx=0;vy=0;
	}
	public boolean Contains(Point point)
	{
		if(this.x<point.x&&this.y<point.y&&point.x<(this.x+this.w)&&point.y<(this.y+this.h))
		{
			return true;
		}
		return false;
	}
	public void paint(Graphics g) {
		// TODO Auto-generated method stub
		g.drawRect(x, y, this.w, this.h);
		
	}

	
}
